﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using ExamDemo.Models;

namespace ExamDemo.Data
{
    public class SayDemoblnitilizer : DropCreateDatabaseAlways<MessagesDb>
    {
        protected override void Seed(MessagesDb db)
        {
            db.Users.Add(new Models.Users
            {
                Username = "第一",
                Password = "123456",
                CreatedAt = DateTime.Now,
                UpdatedAt = DateTime.Now,
                Version = 0
            });
            db.Messages.Add(new Models.Messages
            {
                msgId = 1,
                Message = "来自于1",
                CreatedAt = DateTime.Now,
                UpdatedAt = DateTime.Now,
                Version = 0
            });
            db.Comments.Add(new Models.Comments
            {
                FromUserId = 1,
                Content = "123456",
                CreatedAt = DateTime.Now,
                UpdatedAt = DateTime.Now,
                Version = 0
            });
        }
    }
}